package com.lagou.service.imp;

import com.lagou.dao.EmployeeDao;
import com.lagou.domain.Employee;
import com.lagou.domain.dept;
import com.lagou.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeServiceImpl implements EmployeeService {
    @Autowired
    private EmployeeDao employeeDao;

    public List<Employee> findAll() {
        List<Employee> list = employeeDao.findAll();
        return list;
    }

    public void save(Employee employee) {
        employeeDao.save(employee);
    }

    public Employee findById(Integer id) {
        Employee employee = employeeDao.findById(id);
        return employee;
    }

    @Override
    public List<dept> findDept() {
        List<dept> list = employeeDao.findDept();
        return list;
    }
}
